// web/src/app/api/(social)/conversations/[id]/route.ts

import {NextRequest, NextResponse} from "next/server";
import {db} from "@/lib/db";

export async function GET(
    req: NextRequest,
    {params}: { params: { id: string } }
) {
    let id = params.id;
    try {
        const conversation = await db.conversation.findUnique({
            where: {id}
        })
        return NextResponse.json(conversation)
    } catch (e) {
        console.error(e)
        return new NextResponse('Internal Server Error', {status: 500});
    }
}